<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<script src="static/js/jquery.validate.js"></script>
	<script>
	$(function(){
		$("#CheckRegister").validate({
			rules:{
				username:{required:true,remote:"${pageContext.request.contextPath}/user/check-username"},
			}
		});
	});
</script>


<div id="main">
	<form method="post" action="CheckRegister" id="CheckRegister">
		<fieldset class="edit-panel">
			<legend>用户注册</legend>
			<table>
				<tr>
					<td><label for="username" class="fieldname">用户名： </label></td>
					<td><input type="text" name="username" id="username"/></td>
				</tr>
				<tr>
					<td><label for="password" class="fieldname">密码： </label></td>
					<td><input type="text" name="password" id="password"/></td>
				</tr>
				<tr>
					<td><label for="passwordconfirm" class="fieldname">密码确认： </label></td>
					<td><input type="text" name="passwordconfirm" id="passwordconfirm"/></td>
				</tr>
				<tr>
					<td><label for="name" class="fieldname">姓名： </label></td>
					<td><input type="text" name="name" id="name" /></td>
				</tr>
				<tr>
					<td><label for="address" class="fieldname">地址： </label></td>
					<td><input type="text" name="for="address" id="for="address" /></td>
				</tr>
					<tr>
					<td><label for="phone" class="fieldname">电话： </label></td>
					<td><input type="text" name="for="phone" id="for="phone"/></td>
				</tr>
					<tr>
					<td><label for="email" class="fieldname">邮箱： </label></td>
					<td><input type="text" name="for="email" id="for="email"/></td>
				</tr>
				<div style="color: red; text-align: center;">
					<%=request.getAttribute("erro") != null ? request.getAttribute("erro") : ""%>
				</div>

				<tr>
					<td><label class="fieldname">&nbsp;</label>
					<button>注册</button></td>
					<td><a href="login">登录</a></td>
					</tr>
			</table>

		</fieldset>
	</form>
</div>